package com.tlkj.common.curd.config;

import com.tlkj.common.curd.interceptor.ApiInterfaceInterceptor;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author flyong86
 */
@RequiredArgsConstructor
@Configuration
public class CommonCurdWebConfig implements WebMvcConfigurer {

    private final ApiInterfaceInterceptor apiInterfaceInterceptor;
    /**
     * 添加拦截规则
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(apiInterfaceInterceptor).addPathPatterns("/common/curd/**");
    }

}
